﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.ComponentModel;
using MockupDesigner.AdditionalControls;
using MockupDesigner.Editors.TextEditors;

namespace MockupDesigner.Items
{
    [NumericUpDownEditor]
    public class NumericUpDownItem : ResizableItem
    {
        private decimal val;
        [Category("Prop_Content")]
        public decimal Value
        {
            get { return val; }
            set
            {
                if (this.Value == value) return;
                OnPropertyChanging("Value", this.Value, value);
                val = value;
                (this.Content as NumericUpDown).Value = value;
                OnPropertyChanged("Value");
            }
        }

        private int decimals;
        [Category("Prop_Content")]
        public int Decimals
        {
            get { return decimals; }
            set
            {
                if (this.Decimals == value) return;
                OnPropertyChanging("Decimals", this.Decimals, value);
                decimals = value;
                (this.Content as NumericUpDown).DecimalPlaces = value;
                OnPropertyChanged("Decimals");
            }
        }
    }
}
